package cn.edu.zafu.bigdata.x.hdb;
public class Course {
    private String courseName;
    private String courseNum;
    private String instructor;
    private  double credits;

    // 构造函数
    public Course(String courseName, String courseCode, String instructor, double credits) {
        this.courseName = courseName;
        this.courseNum = courseCode;
        this.instructor = instructor;
        this.credits = credits;
    }

    //设置和获取课程名称
    public void setCourseName(String courseName){
        this.courseName=courseName;
    }
    public String getCourseName(String courseName){
        return courseName;
    }

    //设置和获取课程编号
    public void setCourseNum(String courseNum){
        this.courseNum=courseNum;
    }
    public String getCourseNum(String courseNum){
        return courseNum;
    }

    //设置和获取任课教师
    public void setInstructor(String instructor){
        this.instructor=instructor;
    }
    public String getInstructor(String instructor){
        return instructor;
    }


    //设置和获取学分
    public void setCredits(double credits){
        this.credits=credits;
    }
    public String getCredits(String credits){
        return credits;
    }
    // 打印课程信息的方法
    public void print() {
        System.out.println("课程名: " + courseName);
        System.out.println("课程编码: " + courseNum);
        System.out.println("任课教师: " + instructor);
        System.out.println("课程学分: " + credits);
    }

    // 主方法进行测试
    public static void main(String[] args) {
        //以java面向对象程序设计为例
        Course course = new Course("java面向对象程序设计", "CS666", "吴鹏", 4.0);
        course.print();
    }
}

